namespace hjc {

	export class Aoi extends Component {

		private $active: boolean;
		public get active(): boolean { return this.$active; }
		public set active(active: boolean) {
			if (active !== this.$active) {
				this.emit(!!active ? Func.Entity.onActive : Func.Entity.onInactive, active, !active);
				this.$active = active;
			}
		}

		public init(active?: boolean): void {
			this.$active = false;
			this.$delta = game.frameRate / 2;
			super.resetPfc();
			if (isBoolean(active)) this.active = active;
		}
	}
}